1. Field of the Invention
The present invention generally relates to comparators used in computer and other systems.
2. Description of the Related Art
In a microprocessor it is often necessary to compare two values (A and B) to determine if A is greater than B, B is greater than A or A is equal B. For example, in microprocessors with cache units it is necessary to check if the address of the data or instruction to be fetched is in the cache. To do so the address has to be compared with the upper and lower limits of an address range.
Conventional comparators subtract A from B and determine if the subtraction results in a zero by observing whether a carry-out occurs at the most significant bit of the result. This approach requires a entire adder, even if sum bits are not used. Since speed is critical a look ahead adder or a carry select adder is sometimes used. Such adders increase the size (i.e., area requirement) of the conventional comparator.